//
//  SMBViewController.swift
//  ShareMusic
//
//  Created by 胡岩 on 16/4/29.
//  Copyright © 2016年 胡岩. All rights reserved.
//

import UIKit

class SMBViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        self.view.backgroundColor = UIColor.whiteColor()
        let swipe:UISwipeGestureRecognizer = UISwipeGestureRecognizer.init(target: self, action: #selector(self.swipeLeft(_:)))
        swipe.direction = UISwipeGestureRecognizerDirection.Left
        self.view.addGestureRecognizer(swipe)
        
        let swipeR:UISwipeGestureRecognizer = UISwipeGestureRecognizer.init(target: self, action: #selector(self.swipeRight(_:)))
        swipeR.direction = UISwipeGestureRecognizerDirection.Right
        self.view.addGestureRecognizer(swipeR)
    }
    
    func swipeRight(swipe:UISwipeGestureRecognizer) {
        SMMusicPlayer.shareInstance().open()
    }
    
    func swipeLeft(swipe:UISwipeGestureRecognizer) {
        MusicList.shareInstance().open()
    }
    
    override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.setNavigationBarHidden(false, animated: animated)
    }
    
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
